#!/bin/bash

set -e

rm -rf bin

cleanup_exit() {
  echo "Test failed" ${2}
  exit ${1}
}

echo "Build should fail"
../../build.py build ... || cleanup_exit 1 "build :a #1 succeded"
../../pretty_graph_dump.py bin/__graph__/newgraph.db | diff reference_graph - || cleanup_exit 1 "graph #1 diff"

rm -rf bin

echo 'Test passed'
